.netCHARTING v5.1 Documentation Send comments on this topic.
Mapping Rendering
Getting Started > General Tutorials > Mapping > Mapping Rendering

Glossary Item Box

Rendering

Projections

Projections were created to emulate the surface of the earth on a flat surface such as a monitor. .netCHARTING provides two types of projections; The Lambert Conic, and the Mercator projection.

The following code snippet demonstrates using the Lambert Conic Projection:

[C#]

Chart.Mapping.Projection.Type = ProjectionType.LambertConic;
Chart.Mapping.Projection.Parameters = "-10,-20,-32,49";
[Visual Basic]

Chart.Mapping.Projection.Type = ProjectionType.LambertConic
Chart.Mapping.Projection.Parameters = "-10,-20,-32,49"

 

See samples:

  • Mapping/Projections.aspx

Projections and Performance

Projecting ecw files is a CPU intensive operation. To remedy this feature in a real time rendering environment, the projected ecw views can be cached as jpeg images. This works by simply providing the path and name of a jpeg file where the cached image can be stored as shown in the following code snippet.:

[C#]

MapLayer myLayer = MapDataEngine.LoadLayer("earth.ecw","earth_ecw.jpg);
[Visual Basic]

MapLayer myLayer = MapDataEngine.LoadLayer("earth.ecw","earth_ecw.jpg)

Zooming

A simple API is provided to facilitate zooming. The feature consists of a ZoomPercentage and ZoomCenterPoint properties.

Since shape and ecw files are generally based on the Longitude/Latitude coordinate system, choosing a center point of your zoom can be easily accomplished by finding the GPS coordinates of the particular location. This code snippet demonstrates a simple zoom:

[C#]

 // Zoom 2250% into the coordinates for chicago.
Chart.Mapping.ZoomPercentage = 2250;
Chart.Mapping.ZoomCenterPoint = new PointF(41.9f,-87.65f);

[Visual Basic]
 ' Zoom 2250% into the coordinates for chicago.
Chart.Mapping.ZoomPercentage = 2250
Chart.Mapping.ZoomCenterPoint = New PointF( 41.9F, -87.65F)

The following table shows how GPS coordinates are represented in .netCHARTING:

GPS .netCHARTING
Latitude Longitude: 41°54' N 87°39' W new PointF( 41.54f, -87.39f)
Latitude Longitude: 34° 56' S    138° 35' E new PointF( -34.56f, 138.35f )

 

See sample Mapping/MapZooming.aspx
©2002 - 2008 Webavail Productions Inc. & Corporate Web Solutions Ltd. All Rights Reserved.